// src/main/java/com/bookmanager/service/BookService.java
package com.bookmanager.service;

import com.bookmanager.dao.BookDAO;
import com.bookmanager.model.Book;
import java.util.List;

public class BookService {
    private BookDAO bookDAO = new BookDAO();

    public List<Book> getAllBooks() {
        return bookDAO.getAllBooks();
    }

    public List<Book> searchBooks(String keyword) {
        return bookDAO.searchBooks(keyword);
    }

    public Book getBookById(int bookId) {
        return bookDAO.getBookById(bookId);
    }

    public boolean addBook(Book book) {
        return bookDAO.addBook(book);
    }

    public boolean updateBook(Book book) {
        return bookDAO.updateBook(book);
    }

    public boolean deleteBook(int bookId) {
        return bookDAO.deleteBook(bookId);
    }
}